# ======================================================================
#
# Copyright (C) ADN
# ADN::LIBRARY::ARG::Argument
# Description:
#  - Obtenir et parser les arguments des requetes
#  - Get and parse the arguments
#
# ======================================================================

package ADN::LIBRARY::ARG::Argument;

# #######################
# CREAT OBJECT
# #######################
sub new
{
	# Construction de l'objet $self
	my $self = shift;
	my $class = ref($self) || $self;
	return $self if ref $self;
	$self = bless {} => $class;
  return $self;
}

sub parse
{
	my $self = shift;
	
	@tab = split /\%\!\%\*\%\~\%/smx, $param;
  $nbr = scalar @tab;
  
	print "NBR : $nbr\n";

  for ( my $i = 0; $i < $nbr; $i++ ) {
    @prm = split /\@\#\@\*\@\~\@/smx, $tab[$i];
  }
}

# #######################
# PARSE ARGUMENT FOR SCRIPT
# #######################
sub parse {
  my ( $nbr, $param );
  my ( @tab, @prm );
  $pram = $_[0];
  @tab = split ('\%\!\%\*\%\~\%', $param);
  $nbr = scalar @tab;

  foreach ( @tab ) {
    @prm = split ('\@\#\@\*\@\~\@', $_);
  }
  return \@prm
}  

# #######################
# DESTROY OBJECT
# #######################
sub DESTROY {
    my $self = shift;
    return;
}
1;
__END__